package com.yuwenchao.superafflatus.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuwenchao.superafflatus.constant.AfflatusConstant;
import com.yuwenchao.superafflatus.mapper.IdeaShortcutKeyMapper;
import com.yuwenchao.superafflatus.pojo.entity.IdeaShortcutKey;
import com.yuwenchao.superafflatus.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ChaooGG
 * @since 2021-08-09
 */
@Api(tags = "idea快捷键")
@RestController
@RequestMapping("/ideaShortcutKey")
public class IdeaShortcutKeyController {

    @Autowired
    IdeaShortcutKeyMapper ideaShortcutKeyMapper;




    @ApiOperation("查询idea所有快捷键")
    @GetMapping("getIdeaKey")
    public R getTablePage(@RequestParam(value="page",defaultValue="1") Integer page,
                          @RequestParam(value="remark",defaultValue="") String remark){

        Page<IdeaShortcutKey> pageParam = new Page<>(page, AfflatusConstant.LIMIT_SIZE);
        QueryWrapper<IdeaShortcutKey> queryWrapper = new QueryWrapper<>();
        queryWrapper.like("remark",remark);

        Page<IdeaShortcutKey> ideaShortcutKeyPage = ideaShortcutKeyMapper.selectPage(pageParam, queryWrapper);


        return R.ok().data("ideaShortcutKeyPage",ideaShortcutKeyPage);

    }



}

